import React, { Suspense } from 'react';
import LeftTree from '@/pages/KnowledgeManagement/AnswerLibrary/leftTree';
import RightList from '@/pages/KnowledgeManagement/AnswerLibrary/rightList';
import PageLoading from '@/components/PageLoading';
import { Card, Col, Layout, Row } from 'antd';
const { Content, Sider } = Layout;


class AnswerLibrary extends React.Component{
  sendNodeToRightList = (currentNode) => {
    this.RightList.receiveNode(currentNode);
  }

  render() {
    return (
      <Suspense fallback={<PageLoading />}>
        <Layout style={{ height: '100%' }}>
          <Sider width={260} style={{ background: '#fff',borderRight:"1px solid #EDEDF0" }}>
            <Card className="paddLeft" bordered={false} bodyStyle={{padding:"24px 0"}}>
              <LeftTree sendNodeToRightList={this.sendNodeToRightList} />
            </Card>
          </Sider>
          <Content>
            <Card bordered={false} style={{ height: '100%' }}>
              <RightList onRef={ref => this.RightList = ref} />
            </Card>
          </Content>
        </Layout>
      </Suspense>
    );
  }
}

export default AnswerLibrary;
